package main

import (
	"fmt"
	"go-code/project6/utils"
)

func main() {
	var n1 float64 = 2.2
	var n2 float64 = 1.3
	var operator byte = '*'
	result := utils.Cal(n1, n2, operator)
	fmt.Println(result)

	res1, res2 := getSumAndsub(1, 2)
	fmt.Println(res1, res2)

	test(4)
	res3 := fbnq(4)
	fmt.Println(res3)
	res4 := tz(10)
	fmt.Println(res4)
}

func getSumAndsub(n1, n2 int) (int, int) {
	sum := n1 + n2
	sub := n1 - n2
	return sum, sub
}

func test(n int) {
	if n > 2 {
		n--
		test(n)
	}
	fmt.Println("n=", n)
}

func fbnq(n int) int {
	if n == 1 || n == 2 {
		return 1
	}
	return fbnq(n-1) + fbnq(n-2)
}

func tz(n int) int {
	if n == 1 {
		return 1
	}
	return (tz(n-1) + 1) * 2
}
